//
//  DiscoverService.m
//  SinaWebo
//
//  Created by 亦心 on 16/7/12.
//  Copyright © 2016年 亦心. All rights reserved.
//

#import "DiscoverService.h"
#import "HttpUtil.h"
#import <MJExtension.h>

@implementation DiscoverService

+ (void)getDiscoverWithRequest:(DiscoverRequest *)request success:(void (^)(DiscoverResponse *))success error:(void (^)(NSError *))error{
    [HttpUtil getWithURL:getUserCenterURL params:request.mj_keyValues success:^(id responseObject) {
        if (success) {
            DiscoverResponse *data = [DiscoverResponse mj_objectWithKeyValues:responseObject];
            success(data);
        }
    } failure:^(NSError *failure) {
        if (error) {
            error(failure);
        }
    }];
}

+ (void)getLiveListWithRequest:(LiveListRequest *)request success:(void (^)(LiveListResponse *))success error:(void (^)(NSError *))error{
    [HttpUtil getWithURL:getDiscoverURL params:request.mj_keyValues success:^(id responseObject) {
        if (success) {
            LiveListResponse *data = [LiveListResponse mj_objectWithKeyValues:responseObject];
            success(data);
        }
    } failure:^(NSError *failure) {
        if (error) {
            error(failure);
        }
    }];

}

@end
